package main

import (
	"awesomeTask/application/client"
	"awesomeTask/application/httpServer"
	"awesomeTask/application/nodeServer"
	"awesomeTask/application/server"
	"awesomeTask/application/service"
	"awesomeTask/application/websocket"
	"awesomeTask/commom/parse"
	awesomeTask "awesomeTask/config"
	"awesomeTask/system/echo"
	"fmt"
	"time"
)

func main() {
	/**
	服务注册此处绑定一些应用开始前的必要操作
	*/
	service.Init()
	cmd := echo.GetCmdParams()
	fmt.Println(echo.GetCmdInputParams())
	fmt.Println(cmd, "input——")
	listenPort := parseHelper.Float64ParseInt(awesomeTask.GetConfigByKey("listenPort").(float64))
	go server.RunAsServer(listenPort)
	go client.RunAsNode()
	go websocket.RunWebScoket(int(awesomeTask.GetConfigByKey("websocketListenPort").(float64)))
	go httpServer.RunAsHttpServer(awesomeTask.GetConfigByKey("websocketListenPort").(float64))
	go nodeServer.RunAsNodeServer(awesomeTask.GetConfigByKey("nodePort").(float64))
	for true {
		time.Sleep(30 * time.Second)
	}
}
